<?php

class Damages_Methods_Data_User {

  /**
   *
   * @var int 
   */
  public $id;

  /**
   *
   * @var string 
   */
  public $firstName;

  /**
   *
   * @var string 
   */
  public $lastName;

  /**
   *
   * @var string 
   */
  public $email;

  /**
   *
   * @var string 
   */
  public $position;

  /**
   *
   * @var string 
   */
  public $phone;

  /**
   *
   * @var string 
   */
  public $phoneMobile;

  /**
   *
   * @var string 
   */
  public $phoneFax;

  /**
   *
   * @var boolean
   */
  public $forcePasswordChange;

  /**
   *
   * @var Damages_Methods_Data_Permission 
   */
  public $permission;

  public function __construct(DamagesUsers $user, $skipPermissions = false) {
    $this->id = $user->getId();
    $this->firstName = $user->getFirstName();
    $this->lastName = $user->getLastName();
    $this->email = $user->getEmail();
    $this->position = $user->getPosition();
    $this->phone = $user->getPhone();
    $this->phoneMobile = $user->getPhoneMobile();
    $this->phoneFax = $user->getPhoneFax();
    $this->forcePasswordChange = (bool) $user->getForcePasswordChange();
    if ($skipPermissions !== true)
      $this->permission = new Damages_Methods_Data_Permission($user->getPermissions());
  }

}